#include <iostream>
namespace A
{
    const int size = 10;
}
namespace B
{
    const int size = 20;
}
/*命名空间对define没有约束*/
int main()
{
#if 0
    /*常量指针：指针指向一个常量*/
    int a = 10;
    const int *p = &a;
    a = 20;
    int b = 55;
    p = &b;
    /*p不可改变*/
    // *p=20;
    int *p1 = &a;
    std::cout << *p1 << std::endl;
#endif
#if 0 /*这种写法也是常量指针*/
    int a = 10;
    int const *p = &a;
    int b = 30;
    p = &b;
    a = 20;
#endif
#if 1 /*指针常量(引用的本质)：可以修改指针指向的变量的值，但不能修改指针本身的值*/

    int a = 10;
    // const int *const p = &a;
    int *const p = &a;
    *p = 20;
    a = 30;
#endif

    std::cout << a << std::endl;
    std::cout << *p << std::endl;
    std::cout << A::size << std::endl;
    std::cout << B::size << std::endl;
    return 0;
}